//      rand_helper.h
//      
//      Copyright 2012 tqlong <tqlong@espada>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.

#ifndef BOOST_RANDOM_HELPER_H
#define BOOST_RANDOM_HELPER_H

//#include <boost/random/linear_congruential.hpp>
//#include <boost/random/uniform_int.hpp>
#include <boost/version.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/random/normal_distribution.hpp>
//#include <boost/generator_iterator.hpp>

struct RAND {
#if (BOOST_VERSION / 100) % 100 < 50
  typedef boost::mt19937 base_generator_type;
  typedef boost::variate_generator<base_generator_type&, boost::uniform_real<> > randu_t;
  typedef boost::variate_generator<base_generator_type&, boost::normal_distribution<> > randn_t;
#else
  typedef boost::random::mt19937 base_generator_type;
  typedef boost::random::variate_generator<base_generator_type&, boost::uniform_real<> > randu_t;
  typedef boost::random::variate_generator<base_generator_type&, boost::normal_distribution<> > randn_t;
#endif
  
  static base_generator_type generator;
  static boost::uniform_real<> uni_dist;
  static boost::normal_distribution<> norm_dist;
 
  static randu_t randu() { return randu_t(generator, uni_dist); }
  static randn_t randn() { return randn_t(generator, norm_dist); }
 
};

#endif
